#ifndef SERIALCLIENT_H
#define SERIALCLIENT_H

#include <QObject>
#include "io/serialport.h"

class SerialClient : public QObject
{
    Q_OBJECT
private:
    QString mPortName;
    SerialPort* mpSerialPort;

public:
    explicit SerialClient(QString portName, QObject *parent = nullptr);
    virtual ~SerialClient();

    void open();
    void close();

    qint64 send(QByteArray bytes);
    QByteArray recv(qint64 size = -1);

};

#endif // SERIALCLIENT_H
